﻿Imports CupsApp.Data
Imports CupsApp.Service
Partial Public Class search
    Inherits System.Web.UI.Page

    Public _service As CupsDomainService
    Public _data As PersonalInterview

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        _service = New CupsDomainService
        _data = New PersonalInterview

        If (Not IsPostBack) Then
            CType(Master.FindControl("lnkSearch"), LinkButton).Enabled = False
            CType(Master.FindControl("lnkSearch"), LinkButton).Text = "> Advanced Search <"
            wwDataBinder1.DataBind()

        End If
    End Sub

    Protected Sub btnSearch_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnSearch.Click

        btnSearch_ModalPopupExtender.Show()
        wwDataBinder1.Unbind()
        Page.DataBind()

    End Sub

    Protected Sub ObjectDataSource1_Selecting(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.ObjectDataSourceSelectingEventArgs) Handles ObjectDataSource1.Selecting
        If (IsPostBack) Then
            e.InputParameters("data") = _data
        Else
            e.InputParameters("data") = Nothing
        End If

    End Sub

    Protected Sub CancelSearch_Click(ByVal sender As Object, ByVal e As EventArgs) Handles CancelSearchButton.Click
        btnSearch_ModalPopupExtender.Hide()
    End Sub

    Protected Sub GridView1_PageIndexChanged(ByVal sender As Object, ByVal e As EventArgs) Handles GridView1.PageIndexChanged
        btnSearch_ModalPopupExtender.Show()
    End Sub
End Class